#include "trap.h"
    .set noreorder
    .global main 
    .text 

main:
    li $t1, 0x6f59f5d3
    li $t0, 0x8010abdc
    sw $t1, 0x000001b0($t0)
    lw $s0, 0x000001b0($t0)
    li $s2, 0x6f59f5d3
    bne $s0, $s2, inst_error
    nop

    li $t1, 0x383e8970
    li $t0, 0x80108ae4
    sw $t1, 0x00006d88($t0)
    lw $s0, 0x00006d88($t0)
    li $s2, 0x383e8970
    bne $s0, $s2, inst_error
    nop

    li $t1, 0xe4a9ee00
    li $t0, 0x80110000
    sw $t1, 0x00000000($t0)
    lw $s0, 0x00000000($t0)
    li $s2, 0xe4a9ee00
    bne $s0, $s2, inst_error
    nop

    # 地址错误异常
    li $s0, 0x0f9edafa
    li $t1, 0xdd064458
    li $t0, 0x80105bac
    sw $t1, 0x0000003c($t0)
    lw $s0, 0x0000003e($t0)
    li $s2, 0x0f9edafa
    bne $s0, $s2, inst_error
    nop

    HIT_GOOD_TRAP

inst_error:
    HIT_BAD_TRAP